<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加商品</title>
    <script src="/html/js/axios.min.js"></script>
    <script src="/html/js/util.js"></script>
    <script>
        async function addProduct(){
            let info =await uploadAjaxPost("/product/add",{
                name:$("name").value,
                price:$("price").value,
                origin:$("origin").value,
                date:$("date").value,
                face:$("face").files[0]
            });
            if (info == "ok"){
                location.href="/html/boss/bossIndex.html";
            }
        }
    </script>
</head>
<body>
<div>
    <img id="img" width="200px;" height="260px;"><br>
    <input type="file" id="face" onchange="fileChange('face','img')">
</div>
<div>
    商品名：<input type="text" id="name" ><br><br>
    单&emsp;价：<input type="text" id="price"><br><br>
    产&emsp;地：<input type="text" id="origin"><br><br>
    生产日期：<input type="date" id="date"><br><br>
    <a href="javascript:addProduct()">添加</a>
    <a href="/html/boss/bossIndex.html">返回</a>
</div>
</body>
</html>